import { css } from './styles.js';
import '@shoelace-style/shoelace/dist/components/icon/icon.js';
import '@shoelace-style/shoelace/dist/components/button/button.js';
import '@shoelace-style/shoelace/dist/components/badge/badge.js';
import '@shoelace-style/shoelace/dist/components/avatar/avatar.js';
import '@shoelace-style/shoelace/dist/components/dropdown/dropdown.js';
import '@shoelace-style/shoelace/dist/components/menu/menu.js';
import '@shoelace-style/shoelace/dist/components/menu-item/menu-item.js';
import '@shoelace-style/shoelace/dist/components/tooltip/tooltip.js';
import '@shoelace-style/shoelace/dist/components/avatar/avatar.js';
import '../../../utils/shoelace-config.js';
import '../EmailLogin/index.js';
import '../EmailRegister/index.js';
import '../UserPublish/index.js';
import { 
    render, 
    bindEvents
} from './scripts.js';

class UserActions extends HTMLElement {
    constructor() {
        super();
        this.attachShadow({ mode: 'open' });
        
        // 渲染组件
        this.render();
        
        // 调用js的其它代码
        this.afterRender();

        //调用自动登录


    }

    render() {
        render(this.shadowRoot, css);
    }

    afterRender() {
        bindEvents(this);
    }
}

window.customElements.define('user-actions', UserActions);